import React, { useEffect, useState } from 'react';
import { Form, Radio, Row, Col, Card } from 'antd';
import style from '../index.css'
import { connect } from 'dva';

const theProps = (state) => {
    return {
        mapsInfo: state.maps.mapsInfo,
    }
}



function Setting(props) {
    const { dispatch, mapsInfo } = props;
    const [form] = Form.useForm();
    const onFinish = value => {
        dispatch({
            type: 'task/saveScale',
            payload: value.scale,
        })
    }

    return (
        <Row
            gutter={[16, 8]}
        >
            <Col
                span={10}
            >
                <Card
                    title='矿物识别'
                >
                    <Form
                        name="normal_login"
                        className={style.form}
                        onFinish={onFinish}
                    >
                        <Form.Item
                            name="organicHoles"
                            label="背景色"
                            rules={[
                                {
                                    required: true,
                                },
                            ]}
                            style={{ marginBottom: 0 }}
                        >
                            <Radio.Group defaultValue="a" buttonStyle="solid">
                                <Radio.Button style={{ background: 'rgb(255,255,255)', width: '21em' }} value="a"></Radio.Button>
                            </Radio.Group>
                        </Form.Item>
                        <Form.Item
                            name="organicSeams"
                            label="石英"
                            rules={[
                                {
                                    required: true,
                                },
                            ]}
                            style={{ marginBottom: 0 }}
                        >
                            <Radio.Group defaultValue="a" buttonStyle="solid">             
                                <Radio.Button style={{ background: 'rgb(255,192,192)', width: '21em' }} value="b"></Radio.Button>
                            </Radio.Group>
                        </Form.Item>
                        <Form.Item
                            name="inorganicHoles"
                            label="长石类"
                            rules={[
                                {
                                    required: true,
                                },
                            ]}
                            style={{ marginBottom: 0 }}
                        >
                            <Radio.Group defaultValue="a" buttonStyle="solid">
                                <Radio.Button style={{ background: 'rgb(0,255,255)', width: '21em' }} value="a"></Radio.Button>
                            </Radio.Group>
                        </Form.Item>
                        <Form.Item
                            name="inorganicSeams"
                            label="碳酸盐岩"
                            rules={[
                                {
                                    required: true,
                                },
                            ]}
                            style={{ marginBottom: 0 }}
                        >
                            <Radio.Group defaultValue="a" buttonStyle="solid">
                                <Radio.Button style={{ background: 'rgb(0,192,0)', width: '21em' }} value="b"></Radio.Button>
                            </Radio.Group>
                        </Form.Item>
                        <Form.Item
                            name="inorganicSeams1"
                            label="粘土"
                            rules={[
                                {
                                    required: true,
                                },
                            ]}
                            style={{ marginBottom: 0 }}
                        >
                            <Radio.Group defaultValue="a" buttonStyle="solid">
                                {/* <Radio.Button style={{ background: 'rgb(238,230,133)', width: '7em' }} value="a"></Radio.Button> */}
                                <Radio.Button style={{ background: 'rgb(255,128,128)', width: '21em' }} value="b"></Radio.Button>
                                {/* <Radio.Button style={{ background: 'rgb(238,201,0)', width: '7em' }} value="c"></Radio.Button> */}
                            </Radio.Group>
                        </Form.Item>
                        <Form.Item
                            name="inorganicSeams2"
                            label="其他"
                            rules={[
                                {
                                    required: true,
                                },
                            ]}
                            style={{ marginBottom: 0 }}
                        >
                            <Radio.Group defaultValue="a" buttonStyle="solid">
                                {/* <Radio.Button style={{ background: 'rgb(238,230,133)', width: '7em' }} value="a"></Radio.Button> */}
                                <Radio.Button style={{ background: 'rgb(0,0,0)', width: '21em' }} value="b"></Radio.Button>
                                {/* <Radio.Button style={{ background: 'rgb(238,201,0)', width: '7em' }} value="c"></Radio.Button> */}
                            </Radio.Group>
                        </Form.Item>
                        <Form.Item
                            name="inorganicSeams3"
                            label="黄铁矿"
                            rules={[
                                {
                                    required: true,
                                },
                            ]}
                            style={{ marginBottom: 0 }}
                        >
                            <Radio.Group defaultValue="a" buttonStyle="solid">
                                {/* <Radio.Button style={{ background: 'rgb(238,230,133)', width: '7em' }} value="a"></Radio.Button> */}
                                <Radio.Button style={{ background: 'rgb(255,255,0)', width: '21em' }} value="b"></Radio.Button>
                                {/* <Radio.Button style={{ background: 'rgb(238,201,0)', width: '7em' }} value="c"></Radio.Button> */}
                            </Radio.Group>
                        </Form.Item>
                    </Form>
                </Card>

            </Col>
            <Col
                span={4}
            >
            </Col>
            <Col
                span={10}
            >
                <Card
                    title='孔缝识别'
                >
                    <Form
                        name="normal_login"
                        className={style.form}
                        // initialValues={{ remember: true }}
                        onFinish={onFinish}
                    >
                        <Form.Item
                            name="organicHoles"
                            label="有机孔"
                            rules={[
                                {
                                    required: true,
                                },
                            ]}
                            style={{ marginBottom: 0 }}
                        >
                            <Radio.Group defaultValue="a" buttonStyle="solid">
                                <Radio.Button style={{ background: 'rgb(255,0,0)', width: '21em' }} value="a"></Radio.Button>
                                {/* <Radio.Button style={{ background: 'rgb(0,0,139)', width: '7em' }} value="b"></Radio.Button>
                    <Radio.Button style={{ background: 'rgb(99,184,255)', width: '7em' }} value="c"></Radio.Button> */}
                            </Radio.Group>
                        </Form.Item>
                        <Form.Item
                            name="organicSeams"
                            label="有机缝"
                            rules={[
                                {
                                    required: true,
                                },
                            ]}
                            style={{ marginBottom: 0 }}
                        >
                            <Radio.Group defaultValue="a" buttonStyle="solid">
                                {/* <Radio.Button style={{ background: 'rgb(205,38,38)', width: '7em' }} value="a"></Radio.Button> */}
                                <Radio.Button style={{ background: 'rgb(0,255,255)', width: '21em' }} value="b"></Radio.Button>
                                {/* <Radio.Button style={{ background: 'rgb(240,128,128)', width: '7em' }} value="c"></Radio.Button> */}
                            </Radio.Group>
                        </Form.Item>
                        <Form.Item
                            name="inorganicHoles"
                            label="无机孔"
                            rules={[
                                {
                                    required: true,
                                },
                            ]}
                            style={{ marginBottom: 0 }}
                        >
                            <Radio.Group defaultValue="a" buttonStyle="solid">

                              
                                <Radio.Button style={{ background: 'rgb(0,255,0)', width: '21em' }} value="a"></Radio.Button>
                            </Radio.Group>
                        </Form.Item>
                        <Form.Item
                            name="inorganicSeams"
                            label="无机缝"
                            rules={[
                                {
                                    required: true,
                                },
                            ]}
                            style={{ marginBottom: 0 }}
                        >
                            <Radio.Group defaultValue="a" buttonStyle="solid">
                                
                                <Radio.Button style={{ background: 'rgb(255,255,0)', width: '21em' }} value="b"></Radio.Button>
        
                            </Radio.Group>
                        </Form.Item>
                    </Form>
                </Card>

            </Col>
        </Row>
    )
}

export default connect(theProps, null)(Setting)
